
package com.huawei.esdk.uc.device.bmu.bean;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.bind.annotation.adapters.XmlAdapter;

public class Adapter2
    extends XmlAdapter<String, Date>
{


    public Date unmarshal(String value) {
        try
        {
            return (new SimpleDateFormat("yyyyMMddHHssmm").parse(value));
        }
        catch (ParseException e)
        {
            return null;
        }
    }

    public String marshal(Date value) {
        try
        {
            return (new SimpleDateFormat("yyyyMMddHHssmm").format(value));
        }
        catch (Exception e)
        {
            return null;
        }
    }

}
